package com.mzy.basics.utils.Date;

import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;

/**
 * @author Ives
 * * @date 2021/12/27
 */
public class DateTimeToEndDate {
  /**
   * 生成当天最后的时间
   * @param dateTime
   * @return
   * @throws ParseException
   */
  public static Date dateTimeToEndDate(Date dateTime) throws ParseException{
    Calendar cal = Calendar.getInstance();
    cal.setTime(dateTime);
    cal.set(Calendar.HOUR_OF_DAY, 23);
    cal.set(Calendar.MINUTE, 59);
    cal.set(Calendar.SECOND, 59);
    return cal.getTime();
  }
}
